﻿using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Windows;
using Caliburn.Micro;
using SimplePopup.ViewModels.Dialog;

namespace SimplePopup.ViewModels
{
    [Export]
    public class MainViewModel : Screen
    {
        public IEnumerable<IResult> SayHello()
        {
            var enterNamePopup = (EnterNameViewModel) IoC.GetInstance(typeof (EnterNameViewModel), null);
            yield return new ShowDialogResult("Name please", enterNamePopup);

            // Never use MessageBox in a real application
            MessageBox.Show("Hello " + enterNamePopup.MyName);
        }
    }
}